package com.xwb.cmp;

import com.xwb.entity.Warehouse;

import java.util.Comparator;

public class Mycomparator implements Comparator<Warehouse> {
    @Override
    public int compare(Warehouse o1, Warehouse o2) {
        if(o1.getPrice()>o2.getPrice()) return 1;
        else if(o1.getPrice()==o2.getPrice()) return 0;
        else return -1;
    }

}
